***********************************************************************************************
************					Fig G5 - WTP per Hour Fig by Various Cuts *****
************					
************************************************************************************************/
use .\data\clean\I10W_laneuse_dataset_15nov14_wcensus, clear
drop if holiday==1
drop if dow==0 | dow==6
keep if acct_type=="PRIVATE"
drop TTdiff_ELSpeed
g TTdiff_ELSpeed= (dist/MLspeed)-(dist/ELspeed)
sort acct_no
keep if inlist(hour,5,6,7,8) /*period=="AM Peak"*/
gen WTP=charged_toll/(TTdiff_ELSpeed)
gen temp1=WTP<0
gen Price_per_mile=charged_toll/dist
g miles=cond(dist<2,"0-2", ///
	cond(dist<5, "2-5", ///
	cond(dist<7, "5-7", "7-10.5")))
keep if WTP>0&WTP~=.	
replace TTdiff_ELSpeed=TTdiff_ELSpeed*60
*create frequency
sort acct_no
g count=1
egen freqpermo=sum(count), by(acct_no month)
sort acct_no entry_time
egen appearance=seq(), by(acct_no)


count if TTdiff_ELSpeed>1.5 & freqpermo<4
count if TTdiff_ELSpeed>1.5 & freqpermo>3 & freqpermo<11
count if TTdiff_ELSpeed>1.5 & freqpermo>10 & freqpermo<16
count if TTdiff_ELSpeed>1.5 & freqpermo>15 & freqpermo<21
*** PANEL A
twoway (lpoly WTP TTdiff_ELSpeed if TTdiff_ELSpeed>1.5 & freqpermo<4,bwidth(.05) lc(black)), ///
		 ytitle("Willingness-to-Pay per Hour" "(in dollars)") ///
		 xtitle("Travel Time Difference (in minutes)") xlabel(0(10)30)  ylabel(0(20)120) /// 
	   legend(off) plotregion(style(none)) name(WTP_3, replace) ysc(r(0 125)) scale(1.5)

twoway (lpoly WTP TTdiff_ELSpeed if TTdiff_ELSpeed>1.5 & freqpermo>3 & freqpermo<11,bwidth(.05) lc(black)), ///
		 ytitle("Willingness-to-Pay per Hour" "(in dollars)") ///
		 xtitle("{&Delta}Travel Time (in minutes)") xlabel(0(10)30)  ylabel(0(20)120)  /// 
	   legend(off) plotregion(style(none)) name(WTP_4_10, replace)  ysc(r(0 125)) scale(1.5)

twoway (lpoly WTP TTdiff_ELSpeed if TTdiff_ELSpeed>1.5 & freqpermo>10 & freqpermo<16,bwidth(.05) lc(black)), ///
		 ytitle("Willingness-to-Pay per Hour" "(in dollars)") ///
		 xtitle("{&Delta}Travel Time (in minutes)") xlabel(0(10)30)  ylabel(0(20)120)  /// 
	   legend(off) plotregion(style(none)) name(WTP_11_15, replace)  ysc(r(0 125)) scale(1.5)
twoway (lpoly WTP TTdiff_ELSpeed if TTdiff_ELSpeed>1.5 & freqpermo>15 & freqpermo<21,bwidth(.05) lc(black)), ///
		 ytitle("Willingness-to-Pay per Hour" "(in dollars)") ///
		 xtitle("{&Delta}Travel Time (in minutes)") xlabel(0(10)30)  ylabel(0(20)120)  /// 
	   legend(off) plotregion(style(none)) name(WTP_16_20, replace)  ysc(r(0 125)) scale(1.5)
graph combine WTP_11_15 WTP_16_20, col(2)
graph export .\results\appendix\figs\AF5.png, replace

